//
//  HLTimeCell.m
//  NewKY
//
//  Created by 罗浩林 on 16/11/14.
//  Copyright © 2016年 Dee. All rights reserved.
//

#import "HLTimeCell.h"
#import "UIColor+CZAddition.h"

@interface HLTimeCell ()

@property (nonatomic,strong) UILabel *label;

@end

@implementation HLTimeCell

-(instancetype)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        [self setupuI];
    }
    return  self;
}


-(void)setupuI{
 
    UILabel * label = [UILabel new];
    label.font = [UIFont systemFontOfSize:17];
    label.textColor = [UIColor cz_colorWithHex:0x5a5a5a];
    
    label.text = @"有号";
    [self addSubview:label];
    
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self);
    }];
    
    self.label = label;
    
}

-(void)setCelltext:(NSString *)celltext{
    
    _celltext = celltext;
    
    self.label.text = celltext;
    
    if ([celltext isEqualToString:@"有号"]) {
        UIImageView * imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"HLsaveTemplateEmpty"]];
        
        [self addSubview: imgView];
        
        [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.size.mas_equalTo(CGSizeMake(19, 19));
            make.top.equalTo(self).offset(11);
            make.centerX.equalTo(self);
        }];
        
        [self.label removeFromSuperview];
        
        UILabel * label = [UILabel new];
        label.font = [UIFont systemFontOfSize:14];
        label.textColor = [UIColor cz_colorWithHex:0x5a5a5a];
        
        label.text = @"有号";
        [self addSubview:label];
        
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
           
            make.top.equalTo(imgView.mas_bottom).offset(3);
            make.centerX.equalTo(self);
            
        }];
        
    }
    
    
}


@end
